package com.csp.mingyue.mybatisPlus.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.csp.mingyue.mybatisPlus.model.MingYuePost;
import com.csp.mingyue.mybatisPlus.service.MingYuePostService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 岗位模块接口
 *
 * @author Strive
 * @date 2023/5/12 10:21
 */
@Api(tags = "岗位模块")
@RestController
@RequiredArgsConstructor
@RequestMapping("/post")
public class MingYuePostController {

    private final MingYuePostService mingYuePostService;

    @ApiOperation("分页查询岗位信息")
    @GetMapping("/page")
    public ResponseEntity<IPage<MingYuePost>> page(Page<MingYuePost> page) {
        return ResponseEntity.ok(mingYuePostService.page(page));
    }

    @ApiOperation("分页查询岗位信息(SQl)")
    @GetMapping("/pageSql")
    public ResponseEntity<IPage<MingYuePost>> pageSql(Page page, MingYuePost mingYuePost) {
        return ResponseEntity.ok(mingYuePostService.pageSql(page, mingYuePost));
    }

}
